<div style="height: 400px; overflow-y: scroll;">
    <FluentDataGrid Items=@items Virtualize="true" ItemSize="54" GridTemplateColumns="1fr 1fr 1fr 1fr">
        <ChildContent>
            <PropertyColumn Property="@(c => c.Item1)" Sortable="true" />
            <PropertyColumn Property="@(c => c.Item2)" />
            <PropertyColumn Property="@(c => c.Item3)" Align="Align.Center" />
            <PropertyColumn Property="@(c => c.Item4)" Align="Align.End" />
        </ChildContent>
        <EmptyContent>
            <FluentIcon Value="@(new Icons.Filled.Size24.Crown())" Color="@Color.Accent"/>&nbsp; Nothing to see here. Carry on!
        </EmptyContent>
    </FluentDataGrid>
</div>
<br />
<FluentSwitch @bind-Value="@_clearItems" 
              @bind-Value:after="ToggleItems" 
              UncheckedMessage="Clear all results"
              CheckedMessage="Restore all results">
</FluentSwitch>


@code {
    bool _clearItems = false;
    public record SampleGridData(string Item1, string Item2, string Item3, string Item4);

    IQueryable<SampleGridData>? items = Enumerable.Empty<SampleGridData>().AsQueryable();

    private IQueryable<SampleGridData> GenerateSampleGridData(int size)
    {
        SampleGridData[] data = new SampleGridData[size];

        for (int i = 0; i < size; i++)
        {
            data[i] = new SampleGridData($"value {i}-1", $"value {i}-2", $"value {i}-3", $"value {i}-4");
        }
        return data.AsQueryable();
    }
    protected override void OnInitialized()
    {
        items = GenerateSampleGridData(5000);
    }

    private void ToggleItems()
    {
        if (_clearItems)
		{
			items = null;
		}
		else
		{
			items =GenerateSampleGridData(5000);;
		}
    }
}
